package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum TopicalType {
    //类型，0-发布主题，1-回复主题
    CREATE("0","发布主题"),
    REPLY("1","回复主题");

    private String value;
    private String name;

    public static TopicalType valuesOf(String value) {
        //获取所有枚举集合
        TopicalType[] es = values();
        for (TopicalType e : es) {
            if (Objects.equals(e.getValue(), value)) {
                return e;
            }
        }
        return null;
    }
}
